def getMenuOption(debug = False):
	if debug:
		print "getMenuOption Function"
	validInput = False
	while not validInput:
		option = raw_input("> ")
		option = option.lower()
		if option == "1":
			validInput = True
		elif option == "2":
			validInput = False
		elif option == "3":
			validInput = False
		elif option == "o" or option == "options":
			option = "o"
			validInput = True
		elif (option == "exit" or
			  option == "x" or
			  option == "quit" or
			  option == "q"):
				  option = "exit"
				  validInput = True
		else:
			print "please type a valid option"
			validInput = False
	if debug:
		print "Option is:", option
	return option
			
def getWord(prompt, debug = False):
	if debug:
		print "getWord Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)
		validInput = True
		if option == "":
			print "please type a word"
			validInput = False
		elif isSwear(option, debug):
			print "Don't say such naughty things!"			
			validInput = False
	if debug:
		print "Option:", option 
	return option

def getNumber(prompt, debug = False):
	if debug:
		print "getNumber Function", prompt
	validInput = False
	while not validInput:
		option = raw_input(prompt)
		allowedChars = "123456789."
		validInput = True
		for letter in option:
			if debug:
				print letter
			if not(letter in allowedChars):
				validInput = False
		if not validInput:
			print "please type a number"
	if debug:
		print "Option: ", option
	return option
			
def isSwear(word, debug = False):
	if debug: 
		print "In isSwear Function", word
	swearList = ["jerk",
				 "poopy",
				 "poopy head"]
	if word.lower() in swearList:
		return True
	else:
		return False
		




